package top.zsyle.sycc.fallback;


import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;
import top.zsyle.sycc.exception.GlobalExceptionEnum;
import top.zsyle.sycc.feign.CourseUserLearnService;
import top.zsyle.sycc.result.JsonResult;

@Component
public class CourseUserLearnFallbackFactory implements FallbackFactory<CourseUserLearnService> {

    @Override
    public CourseUserLearnService create(Throwable throwable) {
        return new CourseUserLearnService() {
            @Override
            public JsonResult byInfo(Long courseId, Long loginId) {
                return JsonResult.error(GlobalExceptionEnum.ERROR.getMessage(),GlobalExceptionEnum.ERROR.getCode());
            }
        };
    }
}
